﻿using GC_FFW.Common.Abstractions.Interfaces.Helpers;
using GC_FFW.ForecastWriter.Abstractions.Interfaces.Builders;
using GC_FFW.ForecastWriterClient.Abstractions.Factories;
using GC_FFW.ForecastWriterClient.Abstractions.Interfaces.Factories.ViewModel;
using GC_FFW.ForecastWriterClient.Factories.ViewModel;
using GC_FFW.SoccerfameParser.Abstractions.Interfaces.Builders;
using GC_FFW.SoccerfameParser.Abstractions.Interfaces.Factories;
using GC_FFW.SoccerfameParser.Abstractions.Interfaces.Services;

namespace GC_FFW.ForecastWriterClient.Factories
{
	public class WindowViewModelFactories : WindowViewModelBaseFactories
	{
		#region Variables

		private readonly IForecastDataBuilder _forecastDataBuilder;
		private readonly IForecastStructureBuilder _forecastStructureBuilder;
		private readonly IForecastBuilder _forecastBuilder;
		private readonly ISoccerfameDataHelperFactory _soccerfameDataHelperFactory;
		private readonly IBrowserDialog _browserDialog;
		private readonly IImportService _importService;

		#endregion

		#region Constructors

		public WindowViewModelFactories(IForecastDataBuilder forecastDataBuilder, IForecastStructureBuilder forecastStructureBuilder,
			IForecastBuilder forecastBuilder, ISoccerfameDataHelperFactory soccerfameDataHelperFactory, IBrowserDialog browserDialog,
			IImportService importService)
		{
			_forecastDataBuilder = forecastDataBuilder;
			_forecastStructureBuilder = forecastStructureBuilder;
			_forecastBuilder = forecastBuilder;
			_soccerfameDataHelperFactory = soccerfameDataHelperFactory;
			_browserDialog = browserDialog;
			_importService = importService;
		}

		#endregion

		#region Base Class Members

		public override IForecastManagerViewModelFactory CreateForecastManagerViewModelFactory()
		{
			return new ForecastManagerViewModelFactory();
		}

		public override IMatchDataEditorViewModelFactory CreateMatchDataEditorViewModelFactory()
		{
			return new MatchDataEditorViewModelFactory(_forecastDataBuilder, _soccerfameDataHelperFactory);
		}

		public override IMatchEventsEditorViewModelFactory CreateMatchEventsEditorViewModelFactory()
		{
			return new MatchEventsEditorViewModelFactory(_soccerfameDataHelperFactory);
		}

		public override IForecastEditorViewModelFactory CreateForecastEditorViewModelFactory()
		{
			return new ForecastEditorViewModelFactory(_forecastStructureBuilder, _forecastBuilder);
		}

		public override IImportDataManagerViewModelFactory CreateImportDataManagerViewModelFactory()
		{
			return new ImportDataManagerViewModelFactory(_browserDialog, _importService);
		}

		#endregion
	}
}
